package com.wjx.article_sys.dao;

import com.wjx.article_sys.entity.Admin;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface AdminMapper {
    //根据id查询
    @Select("select * from Admin where Userid = #{id}")
    public Admin queryById(Integer id);
    //根据用户名查询
    @Select("select * from Admin where Username = #{username}")
    public Admin queryByUsername(String username);
    //根据用户名和密码查询
    @Select("select * from Admin where Username = #{username} and Password = #{password}")
    public Admin queryByUsernameAndPassword(String username,String password);
    //添加用户
    @Insert("insert into Admin (Username,Password,Sex,Email,Tel,Photo,Info)" +
            " values (#{username},#{password},#{sex},#{email},#{tel},#{photo},#{info})")
    public void insertAdmin(Admin admin);

}
